package com.defect.po;

import org.springframework.security.core.GrantedAuthority;
import org.springframework.security.core.userdetails.UserDetails;

import java.util.Set;

public class User implements UserDetails {
    private Set<GrantedAuthority> authorities;
    private boolean accountNonExpired = true;
    private boolean accountNonLocked = true;
    private boolean credentialsNonExpired = true;
    private boolean enabled = true;

    @Override
    public Set<GrantedAuthority> getAuthorities() {
        return authorities;
    }

    public void setAuthorities(Set<GrantedAuthority> authorities) {
        this.authorities = authorities;
    }

    @Override
    public boolean isAccountNonExpired() {
        return accountNonExpired;
    }

    public void setAccountNonExpired(boolean accountNonExpired) {
        this.accountNonExpired = accountNonExpired;
    }

    @Override
    public boolean isAccountNonLocked() {
        return accountNonLocked;
    }

    public void setAccountNonLocked(boolean accountNonLocked) {
        this.accountNonLocked = accountNonLocked;
    }

    @Override
    public boolean isCredentialsNonExpired() {
        return credentialsNonExpired;
    }

    public void setCredentialsNonExpired(boolean credentialsNonExpired) {
        this.credentialsNonExpired = credentialsNonExpired;
    }

    @Override
    public boolean isEnabled() {
        return enabled;
    }

    public void setEnabled(boolean enabled) {
        this.enabled = enabled;
    }

    /**
     *
     * This field was generated by MyBatis Generator.
     * This field corresponds to the database column i_issue_user.USER_ID
     *
     * @mbg.generated Thu Jul 30 15:44:59 CST 2020
     */
    private Integer userId;

    /**
     *
     * This field was generated by MyBatis Generator.
     * This field corresponds to the database column i_issue_user.username
     *
     * @mbg.generated Thu Jul 30 15:44:59 CST 2020
     */
    private String username;

    /**
     *
     * This field was generated by MyBatis Generator.
     * This field corresponds to the database column i_issue_user.password
     *
     * @mbg.generated Thu Jul 30 15:44:59 CST 2020
     */
    private String password;

    /**
     *
     * This field was generated by MyBatis Generator.
     * This field corresponds to the database column i_issue_user.ROLE_CODE
     *
     * @mbg.generated Thu Jul 30 15:44:59 CST 2020
     */
    private String roleCode;

    /**
     *
     * This field was generated by MyBatis Generator.
     * This field corresponds to the database column i_issue_user.USER_NAME
     *
     * @mbg.generated Thu Jul 30 15:44:59 CST 2020
     */
    private String userName;

    /**
     *
     * This field was generated by MyBatis Generator.
     * This field corresponds to the database column i_issue_user.USER_SEX
     *
     * @mbg.generated Thu Jul 30 15:44:59 CST 2020
     */
    private String userSex;

    /**
     *
     * This field was generated by MyBatis Generator.
     * This field corresponds to the database column i_issue_user.USER_PHONE
     *
     * @mbg.generated Thu Jul 30 15:44:59 CST 2020
     */
    private String userPhone;

    /**
     *
     * This field was generated by MyBatis Generator.
     * This field corresponds to the database column i_issue_user.USER_EMAIL
     *
     * @mbg.generated Thu Jul 30 15:44:59 CST 2020
     */
    private String userEmail;

    /**
     * This method was generated by MyBatis Generator.
     * This method returns the value of the database column i_issue_user.USER_ID
     *
     * @return the value of i_issue_user.USER_ID
     *
     * @mbg.generated Thu Jul 30 15:44:59 CST 2020
     */
    public Integer getUserId() {
        return userId;
    }

    /**
     * This method was generated by MyBatis Generator.
     * This method sets the value of the database column i_issue_user.USER_ID
     *
     * @param userId the value for i_issue_user.USER_ID
     *
     * @mbg.generated Thu Jul 30 15:44:59 CST 2020
     */
    public void setUserId(Integer userId) {
        this.userId = userId;
    }

    /**
     * This method was generated by MyBatis Generator.
     * This method returns the value of the database column i_issue_user.username
     *
     * @return the value of i_issue_user.username
     *
     * @mbg.generated Thu Jul 30 15:44:59 CST 2020
     */
    public String getUsername() {
        return username;
    }

    /**
     * This method was generated by MyBatis Generator.
     * This method sets the value of the database column i_issue_user.username
     *
     * @param username the value for i_issue_user.username
     *
     * @mbg.generated Thu Jul 30 15:44:59 CST 2020
     */
    public void setUsername(String username) {
        this.username = username == null ? null : username.trim();
    }

    /**
     * This method was generated by MyBatis Generator.
     * This method returns the value of the database column i_issue_user.password
     *
     * @return the value of i_issue_user.password
     *
     * @mbg.generated Thu Jul 30 15:44:59 CST 2020
     */
    public String getPassword() {
        return password;
    }

    /**
     * This method was generated by MyBatis Generator.
     * This method sets the value of the database column i_issue_user.password
     *
     * @param password the value for i_issue_user.password
     *
     * @mbg.generated Thu Jul 30 15:44:59 CST 2020
     */
    public void setPassword(String password) {
        this.password = password == null ? null : password.trim();
    }

    /**
     * This method was generated by MyBatis Generator.
     * This method returns the value of the database column i_issue_user.ROLE_CODE
     *
     * @return the value of i_issue_user.ROLE_CODE
     *
     * @mbg.generated Thu Jul 30 15:44:59 CST 2020
     */
    public String getRoleCode() {
        return roleCode;
    }

    /**
     * This method was generated by MyBatis Generator.
     * This method sets the value of the database column i_issue_user.ROLE_CODE
     *
     * @param roleCode the value for i_issue_user.ROLE_CODE
     *
     * @mbg.generated Thu Jul 30 15:44:59 CST 2020
     */
    public void setRoleCode(String roleCode) {
        this.roleCode = roleCode == null ? null : roleCode.trim();
    }

    /**
     * This method was generated by MyBatis Generator.
     * This method returns the value of the database column i_issue_user.USER_NAME
     *
     * @return the value of i_issue_user.USER_NAME
     *
     * @mbg.generated Thu Jul 30 15:44:59 CST 2020
     */
    public String getUserName() {
        return userName;
    }

    /**
     * This method was generated by MyBatis Generator.
     * This method sets the value of the database column i_issue_user.USER_NAME
     *
     * @param userName the value for i_issue_user.USER_NAME
     *
     * @mbg.generated Thu Jul 30 15:44:59 CST 2020
     */
    public void setUserName(String userName) {
        this.userName = userName == null ? null : userName.trim();
    }

    /**
     * This method was generated by MyBatis Generator.
     * This method returns the value of the database column i_issue_user.USER_SEX
     *
     * @return the value of i_issue_user.USER_SEX
     *
     * @mbg.generated Thu Jul 30 15:44:59 CST 2020
     */
    public String getUserSex() {
        return userSex;
    }

    /**
     * This method was generated by MyBatis Generator.
     * This method sets the value of the database column i_issue_user.USER_SEX
     *
     * @param userSex the value for i_issue_user.USER_SEX
     *
     * @mbg.generated Thu Jul 30 15:44:59 CST 2020
     */
    public void setUserSex(String userSex) {
        this.userSex = userSex == null ? null : userSex.trim();
    }

    /**
     * This method was generated by MyBatis Generator.
     * This method returns the value of the database column i_issue_user.USER_PHONE
     *
     * @return the value of i_issue_user.USER_PHONE
     *
     * @mbg.generated Thu Jul 30 15:44:59 CST 2020
     */
    public String getUserPhone() {
        return userPhone;
    }

    /**
     * This method was generated by MyBatis Generator.
     * This method sets the value of the database column i_issue_user.USER_PHONE
     *
     * @param userPhone the value for i_issue_user.USER_PHONE
     *
     * @mbg.generated Thu Jul 30 15:44:59 CST 2020
     */
    public void setUserPhone(String userPhone) {
        this.userPhone = userPhone == null ? null : userPhone.trim();
    }

    /**
     * This method was generated by MyBatis Generator.
     * This method returns the value of the database column i_issue_user.USER_EMAIL
     *
     * @return the value of i_issue_user.USER_EMAIL
     *
     * @mbg.generated Thu Jul 30 15:44:59 CST 2020
     */
    public String getUserEmail() {
        return userEmail;
    }

    /**
     * This method was generated by MyBatis Generator.
     * This method sets the value of the database column i_issue_user.USER_EMAIL
     *
     * @param userEmail the value for i_issue_user.USER_EMAIL
     *
     * @mbg.generated Thu Jul 30 15:44:59 CST 2020
     */
    public void setUserEmail(String userEmail) {
        this.userEmail = userEmail == null ? null : userEmail.trim();
    }

    @Override
    public String toString() {
        return "User{" +
                "authorities=" + authorities +
                ", accountNonExpired=" + accountNonExpired +
                ", accountNonLocked=" + accountNonLocked +
                ", credentialsNonExpired=" + credentialsNonExpired +
                ", enabled=" + enabled +
                ", userId=" + userId +
                ", username='" + username + '\'' +
                ", password='" + password + '\'' +
                ", roleCode='" + roleCode + '\'' +
                ", userName='" + userName + '\'' +
                ", userSex='" + userSex + '\'' +
                ", userPhone='" + userPhone + '\'' +
                ", userEmail='" + userEmail + '\'' +
                '}';
    }
}